package com.mycompany.app.webapp.action.person;

import org.apache.struts2.config.Result;
import org.apache.struts2.dispatcher.ServletActionRedirectResult;

import com.mycompany.app.model.Person;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;

@Result( name=Action.SUCCESS, value = "list", type=ServletActionRedirectResult.class )
public class SaveAction extends BaseAction {

	private Person person;
	
	public Person getPerson() {
		return person;
	}

	public void setPerson(Person person) {
		this.person = person;
	}

	@Override
	public String execute() throws Exception {
		person = personManager.save(person);
		return ActionSupport.SUCCESS;
	}

}
